#!/bin/sh
IBRC_P2P_CLIENT=../p3_client/ibrc_p2p_client
FOLDER=/tmp/ibrc/
DELAY=0.1

mkdir -p $FOLDER

function start_client {

$IBRC_P2P_CLIENT -ia fe80::cb0a:28ff:73a1:$1 \
      -ma ff15::1 \
      -pm 3000 \
      -pu 400$1 \
      -pc 500$1 \
      -n client$1  \
      --connection-number 3 \
      --log-file $FOLDER/ibrc_client$1.log \
      --info-file $FOLDER/ibrc_client$1.info \
      --raw-data-log-file $FOLDER/ibrc_client$1.raw \
      --input-file $FOLDER/ibrc_client$1.input \
      --output-file $FOLDER/ibrc_client$1.output \
      --peer-discovery-file $FOLDER/ibrc_client$1_pd.info &

  sleep $DELAY


}


#killall -9 ibrc_p2p_client

for i in `seq $1 $2`;
do
  start_client $i
done  

